<template>
	<view class="serverBox">
		<m-block class="more-server" gap="24 30 0 30" spa="20 0">
			<view class="title flex-between" style="padding: 0" @click="Jump('/pages/order/order')">
				<text>更多服务</text>
			</view>
			<view class="ul ul1">
				<view class="li flex" @click="Jump('/pages/mine/myteam/myteam2')" v-if="userinfo.dls == 2">
					<m-icon size="42" type="dzgl" />
					<text class="flex-1 ml-12 ta-left">代理业绩查询</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view>
				<!-- <view class="li flex" @click="Jump('/pages/mine/myteam/myteam2')" v-if="userinfo.dls == 5">
					<m-icon size="42" type="dzgl" />
					<text class="flex-1 ml-12 ta-left">代理业绩查询</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view> -->
				<view class="li flex" @click="Jump('/pages/mine/address/address')">
					<m-icon size="42" type="dzgl" />
					<text class="flex-1 ml-12 ta-left">地址管理</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view>
				<view class="li flex" v-if="[5].includes(Number(userinfo.dls))" @click="Jump('/pages/wallet/swap/auditLists/index?coinid=4')">
					<m-icon size="42" type="syxy" />
					<text class="flex-1 ml-12 ta-left">果實兌換審核</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view>
				<view class="li flex" v-if="[5].includes(Number(userinfo.dls))" @click="Jump('/pages/wallet/swap/auditLists/index?coinid=1')">
					<m-icon size="42" type="syxy" />
					<text class="flex-1 ml-12 ta-left">CNY兌換審核</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view>
				<!-- <view class="li flex" @click="Jump('/pages/mine/information/information')">
					<m-icon size="42" type="smrz" />
					<text class="flex-1 ml-12 ta-left">实名认证</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view> -->

				<!-- <view class="li flex" @click="Jump('/pages/mine/myInvoice/index')">
					<m-icon size="42" type="fpgl" />
					<text class="flex-1 ml-12 ta-left">发票管理</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view> -->
				<!-- <view class="li flex" @click="Jump('/pages/mine/myInvoice/invoicingRecords/invoicingRecords')">
					<m-icon size="42" type="jjfk" />
					<text class="flex-1 ml-12 ta-left">开票记录</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view> -->
				<!-- <view class="li flex" @click="goDialogue()">
					<m-icon size="42" type="zxkf" />
					<text class="flex-1 ml-12 ta-left">联系客服</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view> -->
				<view class="li flex" @click="goWeb('/static/html/agreement.html')">
					<m-icon size="42" type="syxy" />
					<text class="flex-1 ml-12 ta-left">用户协议</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view>
				<view class="li flex" @click="goWeb('/static/html/privacy.html')">
					<m-icon size="42" type="yszc" />
					<text class="flex-1 ml-12 ta-left">隱私政策</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view>
				<view class="li flex" @click="getAppVersion">
					<m-icon size="42" type="dqbb" />
					<text class="flex-1 ml-12 ta-left">版本更新</text>
					<view class="flex">
						<text>{{ version }}</text>
						<m-icon size="24" color="#888" type="icon-qianjin" />
					</view>
				</view>
				<!-- #ifdef APP -->
				<!-- <view class="li flex" @click="goWeb('/static/html/agreement.html')">
					<m-icon size="42" type="gywm" />
					<text class="flex-1 ml-12 ta-left">用户协议</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view>
				<view class="li flex" @click="goWeb('/static/html/privacy.html')">
					<m-icon size="42" type="gywm" />
					<text class="flex-1 ml-12 ta-left">隐私政策</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view>
				<view class="li flex" @click="getAppVersion">
					<m-icon size="42" type="gywm" />
					<text class="flex-1 ml-12 ta-left">版本更新</text>
					<view class="flex">
						<text>{{version}}</text>
						<m-icon size="24" color="#888" type="icon-qianjin" />
					</view>
				</view> -->
				<!-- #endif -->
				<!-- <view class="li flex" @click="Jump('/pages/mine/feedback/submitFeedback/submitFeedback')">
					<m-icon size="42" type="yjfk" />
					<text class="flex-1 ml-12 ta-left">意见反馈</text>
					<m-icon size="24" color="#888" type="icon-qianjin" />
				</view> -->
			</view>
		</m-block>
	</view>
</template>

<script>
import Updater from '@/utils/upgrade.js';
import { invUrl } from '@/common/baseconfig.js';
import { mapState } from 'vuex';
export default {
	name: 'server',
	data() {
		return {
			version: '1.0.0',
			downLink: `${invUrl}pages/login/download/download`
		};
	},
	computed: {
		...mapState({
			userinfo: (state) => state.user.userinfo
		})
	},
	onShow() {},
	onLoad() {},
	methods: {
		jumpFn() {
			if (!this.userinfo.invid) return this.Toast('请先绑定邀请人');
			this.Jump('/pages/home/share/share');
		},
		goWeb(url) {
			uni.navigateTo({
				url: '/pages/webview/webview?url=' + url
			});
		},
		getAppFn() {
			// #ifdef APP-PLUS
			plus.runtime.getProperty(plus.runtime.appid, (info) => {
				console.log('info====>', info);
				this.version = info.version;
			});
			// #endif
		},
		async getAppVersion() {
			const { isUpdate } = await Updater.check();
			if (!isUpdate) {
				this.Toast('当前已是最新版本');
			}
		},
		goDialogue() {
			this.openURL({ openUrl: 'https://work.weixin.qq.com/kfid/kfcfc1ed477fc398781', openType: 'unwebview' });
			// this.Jump({
			// 	url: '/pages/chat/chat',
			// 	params: {
			// 		touid: this.getConfig(999),
			// 		touserName: '平台客服'
			// 	}
			// })
		},
		goDown() {
			if (!this.downLink) return this.Toast('系统打包升级中');
			try {
				// #ifdef APP-PLUS
				this.openURL({ openUrl: this.downLink });
				// #endif
				// #ifndef APP-PLUS
				this.openURL({ openUrl: this.downLink, openType: '1' });
				// #endif
			} catch (e) {
				this.Toast(e);
			}
		}
	}
};
</script>
<style lang="scss">
.more-server {
	.title {
		padding: 0 30rpx;
		font-size: 27rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333;
	}

	.cell_box {
		.cell_right {
			flex: 1;
			padding-left: 42rpx;
		}
	}

	.ul {
		padding-top: 10rpx;
	}

	.ul5 {
		display: grid;
		grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
		grid-row-gap: 30rpx;
		text-align: center;

		text {
			display: block;
			font-size: 24rpx;
			font-family: Source Han Sans CN-Regular, Source Han Sans CN;
			font-weight: 400;
			color: #333333;
		}
	}
}

.ul1 {
	display: grid;
	grid-template-columns: 1fr;
	text-align: center;

	.li {
		padding: 30rpx 0rpx;
	}

	.li + .li {
		border-top: 2rpx solid #eeeeee;
	}

	text {
		display: block;
		font-size: 26rpx;
		font-family: Source Han Sans CN-Regular, Source Han Sans CN;
		font-weight: 400;
		color: #333333;
	}
}
</style>
